import request from '@/utils/request'


// 查询地址信息
export function getAddressListByMemberId(memberId) {
  return request({
    url: '/store/address/getAddressListByMemberId',
    method: 'get',
    params: {
      "memberId": memberId
    }
  })
}

// 查询地址信息
export function changeAddressFlag(id, flag) {
  return request({
    url: '/store/address/changeAddressFlag',
    method: 'get',
    params: {
      id, flag
    }
  })
}

// 查询地址信息
export function getAddressAndCode() {
  return request({
    url: '/store/address/getAddressAndCode',
    method: 'get',
  })
}

// 查询收货地址列表
export function listAddress(query) {
  return request({
    url: '/store/address/list',
    method: 'get',
    params: query
  })
}

// 查询收货地址详细
export function getAddress(id) {
  return request({
    url: '/store/address/' + id,
    method: 'get'
  })
}

// 新增收货地址
export function addAddress(data) {
  return request({
    url: '/store/address',
    method: 'post',
    data: data
  })
}

// 修改收货地址
export function updateAddress(data) {
  return request({
    url: '/store/address',
    method: 'put',
    data: data
  })
}

// 删除收货地址
export function delAddress(id) {
  return request({
    url: '/store/address/' + id,
    method: 'delete'
  })
}
